package com.aiyige.model.request;

import com.aiyige.base.api.ApiManager;

import okhttp3.ResponseBody;
import retrofit2.Call;

/**
 * Created by xiachao
 */

public class MyViewRequest {

    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public String getKeyWord() {
        return keyWord;
    }

    public void setKeyWord(String keyWord) {
        this.keyWord = keyWord;
    }

    Integer pageNum = 0;
    Integer pageSize = 10;
    String keyWord;

    private MyViewRequest(Builder builder) {
        pageNum = builder.pageNum;
        pageSize = builder.pageSize;
        keyWord = builder.keyWord;
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public static final class Builder {
        private Integer pageNum;
        private Integer pageSize;
        private String keyWord;

        public Builder() {
            pageNum = 0;
            pageSize = 15;
            keyWord = null;
        }

        public Builder pageNum(Integer pageNum) {
            this.pageNum = pageNum;
            return this;
        }

        public Builder pageSize(Integer pageSize) {
            this.pageSize = pageSize;
            return this;
        }


        public Builder keyWord(String keyWord) {
            this.keyWord = keyWord;
            return this;
        }


        public Call<ResponseBody> build() {
            return ApiManager.getService().myView(keyWord,pageSize,pageNum);
        }
    }
}
